%% 函数或者脚本说明
%{
- --------------------------------------------------
* 文件名:XXXXXXXXXXXXXXXXX没有启用
* 函数名:None
* 功 能:通过等效电路方法计算RCL
* 变量说明:
* 注意事项:
- --------------------------------------------------
%}
clc; clear; close all;
Frequency_range = linspace(.4, .9, 1000);

%% 定义一些式子
c = 3e8; epsilon_0 = 8.854187817e-12; mu_relative = 1;
h1 = 30e-6; h2 = h1; h3 = h1; h4 = 40e-6; %介质层的高度
omega = Frequency_range * 2 * pi * 1e12;
Z_0 = sqrt(4 * pi * 1e-7 / epsilon_0); % 真空阻抗377
epsilon_relative = HTL_epsilon_real_reshape;

beta = omega / c .* sqrt(mu_relative .* epsilon_relative); % 波数,只和材料相关
Z_c = beta ./ (omega .* epsilon_relative .* epsilon_0); % 材料的特征阻抗 sqrt(mu/epsilon)

Z_d = 1j * Z_c .* tan(beta .* h1); % 不同高度介质的阻抗

%% 求解Z_FSS
function R, C, L = Calculate_RCL(Freq, Zfss)
    %Calculate_RCL - Description
    %
    %
    % Long description
    Real = real(Zfss);
    Imag = imag(Zfss);
    [pks, locs] = findpeaks(abs(Zfss));

end
